export default {
  inserted(el, binding) {
    el.children[0].onblur = () => {
      const cur = binding.value && binding.value[binding.arg]
      if (cur === undefined || cur === null || cur === '') return
      const modifiers = Object.keys(binding.modifiers)
      const precision = modifiers.length ? modifiers[0] : 7
      return (binding.value[binding.arg] =
        ~~(Math.pow(10, precision) * binding.value[binding.arg]) / Math.pow(10, precision))
    }
  }
}
